using System;
using System.ComponentModel;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
namespace SilverSea.Video.Tools
{
	public class frmAdjustFilter : Form
	{
		private BrightnessAdjustEventHandler brightnessAdjustEventHandler_0;
		private ContrastAdjustEventHandler contrastAdjustEventHandler_0;
		private GammaAdjustEventHandler gammaAdjustEventHandler_0;
		private IContainer icontainer_0;
		private TrackBar trackBarContrast;
		private TrackBar trackBarGamma;
		private TrackBar trackBarBrightness;
		private Label label1;
		private Label label2;
		private Label label3;
		private Label labelBrightnessValue;
		private Label labelContrastValue;
		private Label labelGammaValue;
		private Button btnOK;
		private Button btnDefault;
		public event BrightnessAdjustEventHandler BrightnessAdjust
		{
			add
			{
				BrightnessAdjustEventHandler brightnessAdjustEventHandler = this.brightnessAdjustEventHandler_0;
				BrightnessAdjustEventHandler brightnessAdjustEventHandler2;
				do
				{
					brightnessAdjustEventHandler2 = brightnessAdjustEventHandler;
					BrightnessAdjustEventHandler value2 = (BrightnessAdjustEventHandler)Delegate.Combine(brightnessAdjustEventHandler2, value);
					brightnessAdjustEventHandler = Interlocked.CompareExchange<BrightnessAdjustEventHandler>(ref this.brightnessAdjustEventHandler_0, value2, brightnessAdjustEventHandler2);
				}
				while (brightnessAdjustEventHandler != brightnessAdjustEventHandler2);
			}
			remove
			{
				BrightnessAdjustEventHandler brightnessAdjustEventHandler = this.brightnessAdjustEventHandler_0;
				BrightnessAdjustEventHandler brightnessAdjustEventHandler2;
				do
				{
					brightnessAdjustEventHandler2 = brightnessAdjustEventHandler;
					BrightnessAdjustEventHandler value2 = (BrightnessAdjustEventHandler)Delegate.Remove(brightnessAdjustEventHandler2, value);
					brightnessAdjustEventHandler = Interlocked.CompareExchange<BrightnessAdjustEventHandler>(ref this.brightnessAdjustEventHandler_0, value2, brightnessAdjustEventHandler2);
				}
				while (brightnessAdjustEventHandler != brightnessAdjustEventHandler2);
			}
		}
		public event ContrastAdjustEventHandler ContrastAdjust
		{
			add
			{
				ContrastAdjustEventHandler contrastAdjustEventHandler = this.contrastAdjustEventHandler_0;
				ContrastAdjustEventHandler contrastAdjustEventHandler2;
				do
				{
					contrastAdjustEventHandler2 = contrastAdjustEventHandler;
					ContrastAdjustEventHandler value2 = (ContrastAdjustEventHandler)Delegate.Combine(contrastAdjustEventHandler2, value);
					contrastAdjustEventHandler = Interlocked.CompareExchange<ContrastAdjustEventHandler>(ref this.contrastAdjustEventHandler_0, value2, contrastAdjustEventHandler2);
				}
				while (contrastAdjustEventHandler != contrastAdjustEventHandler2);
			}
			remove
			{
				ContrastAdjustEventHandler contrastAdjustEventHandler = this.contrastAdjustEventHandler_0;
				ContrastAdjustEventHandler contrastAdjustEventHandler2;
				do
				{
					contrastAdjustEventHandler2 = contrastAdjustEventHandler;
					ContrastAdjustEventHandler value2 = (ContrastAdjustEventHandler)Delegate.Remove(contrastAdjustEventHandler2, value);
					contrastAdjustEventHandler = Interlocked.CompareExchange<ContrastAdjustEventHandler>(ref this.contrastAdjustEventHandler_0, value2, contrastAdjustEventHandler2);
				}
				while (contrastAdjustEventHandler != contrastAdjustEventHandler2);
			}
		}
		public event GammaAdjustEventHandler GammaAdjust
		{
			add
			{
				GammaAdjustEventHandler gammaAdjustEventHandler = this.gammaAdjustEventHandler_0;
				GammaAdjustEventHandler gammaAdjustEventHandler2;
				do
				{
					gammaAdjustEventHandler2 = gammaAdjustEventHandler;
					GammaAdjustEventHandler value2 = (GammaAdjustEventHandler)Delegate.Combine(gammaAdjustEventHandler2, value);
					gammaAdjustEventHandler = Interlocked.CompareExchange<GammaAdjustEventHandler>(ref this.gammaAdjustEventHandler_0, value2, gammaAdjustEventHandler2);
				}
				while (gammaAdjustEventHandler != gammaAdjustEventHandler2);
			}
			remove
			{
				GammaAdjustEventHandler gammaAdjustEventHandler = this.gammaAdjustEventHandler_0;
				GammaAdjustEventHandler gammaAdjustEventHandler2;
				do
				{
					gammaAdjustEventHandler2 = gammaAdjustEventHandler;
					GammaAdjustEventHandler value2 = (GammaAdjustEventHandler)Delegate.Remove(gammaAdjustEventHandler2, value);
					gammaAdjustEventHandler = Interlocked.CompareExchange<GammaAdjustEventHandler>(ref this.gammaAdjustEventHandler_0, value2, gammaAdjustEventHandler2);
				}
				while (gammaAdjustEventHandler != gammaAdjustEventHandler2);
			}
		}
		public float Brightness
		{
			get
			{
				return (float)this.trackBarBrightness.Value / 10f;
			}
			set
			{
				this.trackBarBrightness.Value = (int)value * 10;
				this.labelBrightnessValue.Text = this.trackBarBrightness.Value.ToString();
			}
		}
		public float Contrast
		{
			get
			{
				return (float)this.trackBarContrast.Value / 10f;
			}
			set
			{
				this.trackBarContrast.Value = (int)value * 10;
				this.labelContrastValue.Text = this.trackBarContrast.Value.ToString();
			}
		}
		public float Gamma
		{
			get
			{
				return (float)this.trackBarGamma.Value / 10f;
			}
			set
			{
				this.trackBarGamma.Value = (int)value * 10;
				this.labelGammaValue.Text = this.trackBarGamma.Value.ToString();
			}
		}
		public frmAdjustFilter()
		{
			this.InitializeComponent();
		}
		private void frmAdjustFilter_Load(object sender, EventArgs e)
		{
		}
		private void trackBarBrightness_Scroll(object sender, EventArgs e)
		{
			this.labelBrightnessValue.Text = this.trackBarBrightness.Value.ToString();
			if (this.brightnessAdjustEventHandler_0 != null)
			{
				this.brightnessAdjustEventHandler_0((float)this.trackBarBrightness.Value / 10f);
			}
		}
		private void trackBarContrast_Scroll(object sender, EventArgs e)
		{
			this.labelContrastValue.Text = this.trackBarContrast.Value.ToString();
			if (this.contrastAdjustEventHandler_0 != null)
			{
				this.contrastAdjustEventHandler_0((float)this.trackBarContrast.Value / 10f);
			}
		}
		private void trackBarGamma_Scroll(object sender, EventArgs e)
		{
			this.labelGammaValue.Text = this.trackBarGamma.Value.ToString();
			if (this.gammaAdjustEventHandler_0 != null)
			{
				this.gammaAdjustEventHandler_0((float)this.trackBarGamma.Value / 10f);
			}
		}
		private void btnDefault_Click(object sender, EventArgs e)
		{
			this.trackBarBrightness.Value = 10;
			this.trackBarContrast.Value = 10;
			this.trackBarGamma.Value = 10;
			this.trackBarBrightness_Scroll(null, null);
			this.trackBarContrast_Scroll(null, null);
			this.trackBarGamma_Scroll(null, null);
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.icontainer_0 != null)
			{
				this.icontainer_0.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmAdjustFilter));
            this.trackBarContrast = new System.Windows.Forms.TrackBar();
            this.trackBarGamma = new System.Windows.Forms.TrackBar();
            this.trackBarBrightness = new System.Windows.Forms.TrackBar();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.labelBrightnessValue = new System.Windows.Forms.Label();
            this.labelContrastValue = new System.Windows.Forms.Label();
            this.labelGammaValue = new System.Windows.Forms.Label();
            this.btnOK = new System.Windows.Forms.Button();
            this.btnDefault = new System.Windows.Forms.Button();
            ((System.ComponentModel.ISupportInitialize)(this.trackBarContrast)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.trackBarGamma)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.trackBarBrightness)).BeginInit();
            this.SuspendLayout();
            // 
            // trackBarContrast
            // 
            resources.ApplyResources(this.trackBarContrast, "trackBarContrast");
            this.trackBarContrast.Maximum = 20;
            this.trackBarContrast.Name = "trackBarContrast";
            this.trackBarContrast.Scroll += new System.EventHandler(this.trackBarContrast_Scroll);
            // 
            // trackBarGamma
            // 
            resources.ApplyResources(this.trackBarGamma, "trackBarGamma");
            this.trackBarGamma.Maximum = 100;
            this.trackBarGamma.Name = "trackBarGamma";
            this.trackBarGamma.TickFrequency = 5;
            this.trackBarGamma.Scroll += new System.EventHandler(this.trackBarGamma_Scroll);
            // 
            // trackBarBrightness
            // 
            resources.ApplyResources(this.trackBarBrightness, "trackBarBrightness");
            this.trackBarBrightness.Maximum = 20;
            this.trackBarBrightness.Name = "trackBarBrightness";
            this.trackBarBrightness.Scroll += new System.EventHandler(this.trackBarBrightness_Scroll);
            // 
            // label1
            // 
            resources.ApplyResources(this.label1, "label1");
            this.label1.Name = "label1";
            // 
            // label2
            // 
            resources.ApplyResources(this.label2, "label2");
            this.label2.Name = "label2";
            // 
            // label3
            // 
            resources.ApplyResources(this.label3, "label3");
            this.label3.Name = "label3";
            // 
            // labelBrightnessValue
            // 
            resources.ApplyResources(this.labelBrightnessValue, "labelBrightnessValue");
            this.labelBrightnessValue.Name = "labelBrightnessValue";
            // 
            // labelContrastValue
            // 
            resources.ApplyResources(this.labelContrastValue, "labelContrastValue");
            this.labelContrastValue.Name = "labelContrastValue";
            // 
            // labelGammaValue
            // 
            resources.ApplyResources(this.labelGammaValue, "labelGammaValue");
            this.labelGammaValue.Name = "labelGammaValue";
            // 
            // btnOK
            // 
            this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
            resources.ApplyResources(this.btnOK, "btnOK");
            this.btnOK.Name = "btnOK";
            this.btnOK.UseVisualStyleBackColor = true;
            // 
            // btnDefault
            // 
            resources.ApplyResources(this.btnDefault, "btnDefault");
            this.btnDefault.Name = "btnDefault";
            this.btnDefault.UseVisualStyleBackColor = true;
            this.btnDefault.Click += new System.EventHandler(this.btnDefault_Click);
            // 
            // frmAdjustFilter
            // 
            this.AcceptButton = this.btnOK;
            resources.ApplyResources(this, "$this");
            this.Controls.Add(this.btnDefault);
            this.Controls.Add(this.btnOK);
            this.Controls.Add(this.labelGammaValue);
            this.Controls.Add(this.labelContrastValue);
            this.Controls.Add(this.labelBrightnessValue);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.trackBarBrightness);
            this.Controls.Add(this.trackBarGamma);
            this.Controls.Add(this.trackBarContrast);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "frmAdjustFilter";
            this.Load += new System.EventHandler(this.frmAdjustFilter_Load);
            ((System.ComponentModel.ISupportInitialize)(this.trackBarContrast)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.trackBarGamma)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.trackBarBrightness)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

		}
	}
}
